<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="xView-min.js"></script>

<script type="text/javascript">

$(function(){
	//设置form值
	xView.setForm($("#form"),
	{a:{b:34234325450}
	,city:1
	,c1:[1,2]//喜欢的食物
	,r1:1//配送方式
	,select:2
	,textarea:"我是一个文本域"});
	
	//取出form的值
	$("#formData").html(JSON.stringify(xView.getForm($("#form"))));
	
})

</script>


</head>
<body>
<div>form操作</div>
<form id="form" action="">
<span>你想去的城市:</span>
<input type="text" name="city" data-view="{data:'enum',view:{1:'南昌',2:'北京'}}">
<br>
<span>喜欢的食物:</span>
<input type="checkbox" name="c1" value="1" >肉
<input type="checkbox" name="c1" value="2" >水果
<input type="checkbox" name="c1" value="3" >鱼
<br>
<span>选择配送方式:</span>
<input type="radio" name="r1" value="1" >韵达
<input type="radio" name="r1" value="2" >圆通
<input type="radio" name="r1" value="3" >顺丰

<br>
<span>喜欢的课程:</span>
<select name="select">
<option value="1"> 英语</option>
<option value="2"> 数学</option>
<option value="3"> 语文</option>
</select>
<br>
<textarea name="textarea" rows="" cols=""></textarea>
</form>
<div>取出form的值：</div>
<div id="formData"></div>
</body>
</html>